home *** CD-ROM | disk | FTP | other *** search
Text File | 1987-01-06 | 5.8 KB | 300 lines | [TEXT/EDIT] |
- // quickdraw.h
- // © Copyright 1984 Consulair Corp, All Rights Reserved.
- // Portions © Copyright Apple Computer, Inc: 1982, 1983, 1984
- // Stanford University, SUMEX project: 1984
- // Requires Macdefs.h
-
- #ifndef QuickdrawLoaded
-
- #ifndef MacdefsLoaded
- #include "macdefs.h"
- #endif
-
- #define QuickdrawLoaded
-
- // Really belongs in font.h
-
- #define Style short
-
- // the 16 transfer modes
-
- #define srcCopy 0
- #define srcOr 1
- #define srcXor 2
- #define srcBic 3
- #define notSrcCopy 4
- #define notSrcOr 5
- #define notSrcXor 6
- #define notSrcBic 7
- #define patCopy 8
- #define patOr 9
- #define patXor 10
- #define patBic 11
- #define notPatCopy 12
- #define notPatOr 13
- #define notPatXor 14
- #define notPatBic 15
-
- // QuickDraw color separation constants
-
- // normal screen mapping
-
- #define normalBit 0
-
- // inverse screen mapping
-
- #define inverseBit 1
-
- // RGB additive mapping
-
- #define redBit 4
- #define greenBit 3
- #define blueBit 2
-
- // CMYBk subtractive mapping
-
- #define cyanBit 8
- #define magentaBit 7
- #define yellowBit 6
- #define blackBit 5
-
- // colors expressed in these mappings
-
- #define blackColor 33
- #define whiteColor 30
- #define redColor 205
- #define greenColor 341
- #define blueColor 409
- #define cyanColor 273
- #define magentaColor 137
- #define yellowColor 69
-
- // standard picture comments
-
- #define picLParen 0
- #define picRParen 1
-
- // And drawing modes
-
- #define frameMode 0
- #define paintMode 1
- #define eraseMode 2
- #define invertMode 3
- #define fillMode 4
-
- // add constants for cursors in system file
-
- #define iBeamCursor 1
- #define crossCursor 2
- #define plusCursor 3
- #define watchCursor 4
-
- // General Types
-
- struct __P
- {
- char s[8];
- };
-
- #define Pattern struct __P
- typedef Pattern * PatPtr;
- typedef PatPtr * PatHandle;
-
- typedef struct
- {
- short s[16];
- } Bits16;
-
- #define GrafVerb short
-
- // Screen and graph Structures
-
- struct __B
- {
- Ptr baseAddr;
- short rowBytes;
- Rect bounds;
- };
-
- #define BitMap struct __B
-
- struct __C
- {
- Bits16 data;
- Bits16 mask;
- Point hotSpot;
- };
-
- #define Cursor struct __C
-
- typedef Cursor * CursPtr;
- typedef CursPtr * CursHandle;
-
- struct __PS
- {
- Point pnLoc;
- Point pnSize;
- short pnMode;
- Pattern pnPat;
- };
-
- #define PenState struct __PS
-
- struct __PY
- {
- short polySize;
- Rect polyBBox;
- Point polyPoints[1];
- };
-
- #define Polygon struct __PY
-
- typedef Polygon * PolyPtr;
- typedef PolyPtr * PolyHandle;
-
- struct __RG
- {
- short rgnSize; // = 10 for rectangular
- Rect rgnBBox;
- // plus more data if not rectangular
- };
-
- #define Region struct __RG
-
- typedef Region * RgnPtr;
- typedef RgnPtr * RgnHandle;
-
- struct __PI
- {
- short picSize;
- Rect picFrame;
- // plus byte codes for picture content
- };
-
- #define Picture struct __PI
-
- typedef Picture * PicPtr;
- typedef PicPtr * PicHandle;
-
- struct __Q
- {
- int (*textProc)();
- int (*lineProc)();
- int (*rectProc)();
- int (*rRectProc)();
- int (*ovalProc)();
- int (*arcProc)();
- int (*polyProc)();
- int (*rgnProc)();
- int (*bitsProc)();
- int (*commentProc)();
- int (*txMeasProc)();
- int (*getPicProc)();
- int (*putPicProc)();
- };
-
- #define QDProcs struct __Q
-
- typedef QDProcs * QDProcsPtr;
-
- struct __GP
- {
- short device;
- BitMap portBits;
- Rect portRect;
- RgnHandle visRgn;
- RgnHandle clipRgn;
- Pattern bkPat;
- Pattern fillPat;
- Point pnLoc;
- Point pnSize;
- short pnMode;
- Pattern pnPat;
- short pnVis;
- short txFont;
- Style txFace;
- short txMode;
- short txSize;
- long spExtra;
- long fgColor;
- long bkColor;
- short colrBit;
- short patStretch;
- Handle picSave;
- Handle rgnSave;
- Handle polySave;
- QDProcsPtr grafProcs;
- };
-
- #define GrafPort struct __GP
-
- typedef GrafPort * GrafPtr;
-
- struct __FO // Really should be in font.h
- {
- short errNum;
- Handle fontHandle;
- char bold;
- char italic;
- char ulOffset;
- char ulShadow;
- char ulThick;
- char shadow;
- char extra;
- char ascent;
- char descent;
- char widMax;
- char leading;
- char unused;
- Point numer;
- Point denom;
- };
-
- #define FMOutRec struct __FO
-
- typedef FMOutRec *FMOutPtr;
-
- struct QDVar
- {
- FMOutRec fontData; // font manager output record
- FMOutPtr fontPtr; // last font used; used by DrawText
- long fontAdj; // fixed point to adjust for font subst
- Point patAlign; // to align pattern during DrawPicture
- short polyMax; // max bytes allocated so far to thePoly
- PolyHandle thePoly; // the current polygon being defined
- short playIndex; // used by StdGetPic
- PicHandle playPic;
- short rgnMax; // max bytes allocated so far to rgnBuf
- short rgnIndex; // current bytes used in rgnBuf
- Handle rgnBuf; // buffer for OpenRgn
- Region wideData; // a dummy rectangular region, readonly
- RgnPtr wideMaster;
- RgnHandle wideOpen;
- long randSeed; // random number generator seed
- BitMap screenBits; // mac screen
- Cursor arrow; // pointing arrow cursor
- Pattern dkGray; // standard grey patterns
- Pattern ltGray;
- Pattern gray;
- Pattern black;
- Pattern white;
- GrafPtr QDthePort; // current pointer to grafPort
- };
-
- extern struct QDVar *QD;
- #define thePort (QD->QDthePort)
-
- // Functions returning other than integer
-
- #define GetCursor (CursHandle)GetCursor
- #define GetIcon (Handle)GetIcon
- #define GetPattern (PatHandle)GetPattern
- #define GetPicture (PicHandle)GetPicture
- #define NewRgn (RgnHandle)NewRgn
- #define OpenPicture (PicHandle)OpenPicture
- #define OpenPoly (PolyHandle)OpenPoly
-
- #endif
-
-
-